//
//  RootVC.m
//  SuperCalendar
//
//  Created by leo on 15/11/7.
//  Copyright © 2015年 leo. All rights reserved.
//

#import "RootVC.h"
#import "HomeVC.h"
#import "CommunityVC.h"
#import "FindVC.h"
#import "MeVC.h"

@interface RootVC ()

@end

@implementation RootVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self initTabView];
}

#pragma mark - 加载tabbar
- (void)initTabView {
    HomeVC *homeVC = [[HomeVC alloc] init];
    homeVC.tabBarItem.title = @"首页";
    [homeVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:252/255.0 green:120/255.0 blue:57/255.0 alpha:1.0]} forState:UIControlStateHighlighted];
    homeVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-2"];
    homeVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"iconfont-unie8e9"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:homeVC];
    homeNav.navigationBarHidden = YES;
    
    CommunityVC *communityVC = [[CommunityVC alloc] init];
    communityVC.tabBarItem.title = @"社区";
    [communityVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:252/255.0 green:120/255.0 blue:57/255.0 alpha:1]} forState:UIControlStateHighlighted];
    communityVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-3"];
    communityVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"iconfont-社区12"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *communityNav = [[UINavigationController alloc] initWithRootViewController:communityVC];
    communityNav.navigationBarHidden = YES;
    
    FindVC *findVC = [[FindVC alloc] init];
    findVC.tabBarItem.title = @"发现";
    [findVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:252/255.0 green:120/255.0 blue:57/255.0 alpha:1]} forState:UIControlStateHighlighted];
    findVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-1"];
    findVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"iconfont-icon发现12"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *findNav = [[UINavigationController alloc] initWithRootViewController:findVC];
    findNav.navigationBarHidden = YES;
    
    MeVC *meVC = [[MeVC alloc] init];
    meVC.tabBarItem.title = @"我";
    [meVC.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:252/255.0 green:120/255.0 blue:57/255.0 alpha:1]} forState:UIControlStateHighlighted];
    meVC.tabBarItem.image = [UIImage imageNamed:@"iconfont-4"];
    meVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"iconfont-我12"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController *meNav = [[UINavigationController alloc] initWithRootViewController:meVC];
    meNav.navigationBarHidden = YES;
    
    
    self.viewControllers= @[homeNav,communityNav,findNav,meNav];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
